package com.atguigu.tingshu.album.service;

import com.atguigu.tingshu.model.album.TrackInfo;
import com.atguigu.tingshu.query.album.TrackInfoQuery;
import com.atguigu.tingshu.vo.album.*;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;

public interface TrackInfoService extends IService<TrackInfo> {

    /**
     * 保存声音
     * @param trackInfoVo
     * @param userId
     */
    void saveTrackInfo(TrackInfoVo trackInfoVo, Long userId);


    /**
     * 保存声音统计信息
     * @param trackId 声音ID
     * @param statType 统计类型
     * @param statNum 统计数值
     */
    void saveTrackStat(Long trackId, String statType, int statNum);


    Page<TrackListVo> getUserTrackPage(Page<TrackListVo> pageInfo,
                                       TrackInfoQuery trackInfoQuery);

    void updateTrackInfo(Long id,TrackInfoVo trackInfovo);

    void removeTrackInfo(Long id);


    IPage<AlbumTrackListVo> findAlbumTrackPage(
            IPage<AlbumTrackListVo> pageInfo, Long albumId, Long userId);

    void updateTrackStat(TrackStatMqVo mqVo);


    /**
     * 查询声音统计信息
     * @param trackId
     * @return
     */
    TrackStatVo getTrackStatVo(Long trackId);
}
